package net.csdn.business.common.domain;

import lombok.Data;

import javax.validation.constraints.Positive;
import javax.validation.constraints.PositiveOrZero;
import java.io.Serializable;

/**
 * @author likun
 * @date 2023/5/9 18:55
 */
@Data
public class PageQueryParamDTO implements Serializable {
    /**
     * 页码
     */
    @PositiveOrZero(message = "pageNum 格式不正确")
    private Integer pageNum = 1;

    /**
     * 每页大小
     */
    @Positive(message = "pageSize 格式不正确")
    private Integer pageSize = 20;

    public Integer getPageNum() {
        return PageDto.getPage(pageNum);
    }

    public Integer getPageSize() {
        return PageDto.getPageSize(pageSize);
    }
}